package com.nuc.bigdata.orm.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nuc.bigdata.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;

/**
 * @author JackLuo
 * @date 2019/11/13
 */
@ApiModel(value = "图片实体信息类",description = "上传图片时记录在数据库中的信息",parent = BaseEntity.class)
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "picture")
public class Picture extends BaseEntity {

    @ApiModelProperty(value = "表主键",accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "图片唯一标识",example = "3e89bb375ac84dc2bc32eb1d33f88410")
    @NotEmpty
    private String pictureId;

    @ApiModelProperty(value = "图片原始名称")
    @NotEmpty
    @Length(max = 100)
    private String pictureOriginalName;

    @ApiModelProperty(value = "图片存储路径")
    @NotEmpty
    @Length(max = 200)
    private String picturePath;

    @ApiModelProperty(value = "图片新名称")
    @NotEmpty
    @Length(max = 100)
    private String pictureName;

    @ApiModelProperty(value = "图片类型")
    @NotEmpty
    @Length(max = 100)
    private String pictureType;

    @ApiModelProperty(value = "图片大小")
    @NotEmpty
    @Length(max = 10)
    private BigDecimal pictureSize;

    @ApiModelProperty(value = "图片大小单位")
    @NotEmpty
    private String pictureSizeUom;

    @ApiModelProperty(value = "图片缩略图名称")
    @Length(max = 100)
    private String thumbnail;
}
